#ifndef _COMPARE_H_
#define _COMPARE_H_

/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>

/* Public typedef -----------------------------------------------------------*/
/* Public define ------------------------------------------------------------*/
/* Public macro --------------------------------------------------------------*/
#define MAX_SWITCH(value, contrast)                  \
{                                                   \
    if((contrast) > (value))                        \
    {   value = contrast;   }                       \
}
#define MIN_SWITCH(value, contrast)                  \
{                                                   \
    if((contrast) < (value) || (value) == 0)        \
    {   value = contrast;   }                       \
}
#define MAX_SWITCH_HANDLE(value, contrast, handle)  \
{                                                   \
    if((contrast) > (value))                        \
    {                                               \
        value = contrast;                           \
        handle;                                      \
    }                                               \
}
#define MIN_SWITCH_HANDLE(value, contrast, handle)  \
{                                                   \
    if((contrast) < (value) || (value) == 0)        \
    {                                               \
        value = contrast;                           \
        handle;                                     \
    }                                               \
}

#define SIGN_IS_SAME(x, y) (((x) * (y)) > 0)
/* Public variables ----------------------------------------------------------*/
/* Public function prototypes ------------------------------------------------*/
bool Array_IsSame(void *array1, void *array2, size_t length);

#endif
